package com.jims.api.v1.controller.common;

import com.jims.master.common.data.Message;
import com.jims.master.common.utils.SecurityUtil;
import com.jims.master.modules.sys.entity.Dict;
import com.jims.master.modules.sys.service.DictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 地域信息
 * @author jict
 * @version 2017-11-21
 */
@RestController
@RequestMapping(value = "dict")
public class DictController {
    @Autowired
    private DictService dictService;

     /**
       * @Title:
       * @Description: （根据type查找对应字典）
        * @param type
       * @return
       * @author jict
       * @date 2017/11/22
       * @throws
      */
    @RequestMapping(value = "V100/getDictList",method ={RequestMethod.GET,RequestMethod.POST})
    public String getDictList(@RequestParam(required=true) String type) {
        Message msg=new Message();
        List<Dict> list = dictService.getDictList(type);
        msg.setData(list);
        return SecurityUtil.encryptMsgData(msg);
    }
    
}
